<script type='text/javascript'>

    $(document).ready(function(){

        $("#btn_pilih_NOP").click(function(){
            $("#dialog-objek").dialog('open');
        });

    });


    //function PilihNop(no_op){
    //$("#no_op").val(no_op);
    //$("#dialog-objek").dialog('close');
    //}

    function PilihNop(no_op){
        $("#no_op").val(no_op);
        $("#nama_pmk").val(nm_pmk)
						
        $("#alamat_pmk").val(alamat_pmk)
        $("#dialog-objek").dialog('close');						
        //coba
	
    }



</script>

<?php
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array(
    'id' => 'horizontalForm',
    'type' => 'horizontal',
    'enableAjaxValidation' => false,
        ));
?>
<fieldset>
    <p class="help-block">Fields with <span class="required">*</span> are required.</p>

    <?php echo $form->errorSummary($model); ?>

    <div class="control-group ">
        <label class="control-label" for="Nama Pemilik"><b>No Pemohon </b>:</label>
        <div class="controls">
            <?php echo $form->textField($model, 'nama_pmk', array('class' => 'span1', 'maxlength' => 35)); ?>
        </div>
    </div>

    <div class="control-group ">
        <label class="control-label" for="Nama Pemilik"><b>No SSPD</b>:</label>
        <div class="controls">
            <?php echo $form->textField($model, 'nama_pmk', array('class' => 'span1', 'maxlength' => 35)); ?>
        </div>
    </div>


    <div class="control-group ">
        <label class="control-label" for="Nama Pemilik"><b>Nomor Objek Pajak </b>:</label>
        <div class="controls">
            <input type = "text" name="no_op[]" id="no_op" class="span1">
            <input type = "text" name="no_op[]" class="span1" >
            <input type = "text" name="no_op[]" class="span1" >
            <input type = "text" name="no_op[]" class="span1" >
            -
            <input type = "text" name="no_op[]" class="span1" >
            <input type = "text" name="no_op[]" class="span1" >
            <input type = "text" name="no_op[]" class="span1" >
            -

            <input type = "text" name="no_op[]" class="span1" >
            <input type = "text" name="no_op[]" class="span1" >
            <input type = "text" name="no_op[]" class="span1" >
            -
            <input type = "text" name="no_op[]" class="span1" >
            <input type = "text" name="no_op[]" class="span1" >
            <input type = "text" name="no_op[]" class="span1" >
            -
            <input type = "text" name="no_op[]" class="span1" >
            <input type = "text" name="no_op[]" class="span1" >
            <input type = "text" name="no_op[]" class="span1" >
            <input type = "text" name="no_op[]" class="span1" >
            -
            <input type = "text" name="no_op[]" class="span1" >

            <?php
            $this->widget('bootstrap.widgets.TbButton', array(
                'id' => 'btn_pilih_NOP',
                'type' => 'primary',
                'label' => 'F2',
            ));
            ?>

        </div>
    </div>


    <div class="control-group ">
        <label class="control-label" for="Nama Pemilik">LETAK BANGUNAN :</label>
        <div class="controls">
            <?php echo $form->textField($model, 'nama_pmk', array('class' => 'span5', 'maxlength' => 35)); ?>
        </div>
    </div>

    <div class="control-group ">
        <label class="control-label" for="Nama Pemilik">KECAMATAN :</label>
        <div class="controls">
            <?php echo $form->textField($model, 'nama_pmk', array('class' => 'span2', 'maxlength' => 35)); ?>
        </div>
    </div>

    <div class="control-group ">
        <label class="control-label" for="Nama Pemilik">KELURAHAN/DESA :</label>
        <div class="controls">
            <?php echo $form->textField($model, 'nama_pmk', array('class' => 'span2', 'maxlength' => 35)); ?>
        </div>
    </div>

    <div class="control-group ">
        <label class="control-label" for="Nama Pemilik">RT :</label>
        <div class="controls">
            <?php echo $form->textField($model, 'nama_pmk', array('class' => 'span1', 'maxlength' => 35)); ?>
        </div>
    </div>

    <div class="control-group ">
        <label class="control-label" for="Nama Pemilik">RW :</label>
        <div class="controls">
            <?php echo $form->textField($model, 'nama_pmk', array('class' => 'span1', 'maxlength' => 35)); ?>
        </div>
    </div>

    <div class="control-group ">
        <label class="control-label" for="Nama Pemilik"><b>KABUPATEN</b>:</label>
        <div class="controls">
            <?php echo $form->textField($model, 'nama_pmk', array('class' => 'span3', 'maxlength' => 35)); ?>
        </div>
    </div>

    <div class="control-group ">
        <label class="control-label" for="Nama Pemilik">RW :</label>
        <div class="controls">
            <?php echo $form->textField($model, 'nama_pmk', array('class' => 'span1', 'maxlength' => 35)); ?>
        </div>
    </div>    

    <div class="control-group ">
        <label class="control-label" for="Nama Pemilik">NAMA PEMILIK :</label>
        <div class="controls">
            <?php echo $form->textField($model, 'nama_pmk', array('class' => 'span3', 'maxlength' => 35)); ?>
        </div>
    </div>


    <div class="control-group ">
        <label class="control-label" for="Nama Pemilik">ALAMAT PEMILIK :</label>
        <div class="controls">
            <?php echo $form->textField($model, 'nama_pmk', array('class' => 'span3', 'maxlength' => 35)); ?>
        </div>
    </div>

    <div class="control-group ">
        <label class="control-label" for="Nama Pemilik">NJOP BUMI :</label>
        <div class="controls">
            <?php echo $form->textField($model, 'nama_pmk', array('class' => 'span2', 'maxlength' => 35)); ?>
        </div>
    </div>

    <div class="control-group ">
        <label class="control-label" for="Nama Pemilik">NJOP BANGUNAN :</label>
        <div class="controls">
            <?php echo $form->textField($model, 'nama_pmk', array('class' => 'span2', 'maxlength' => 35)); ?>
        </div>
    </div>

    <div class="control-group ">
        <label class="control-label" for="Nama Pemilik">LUAS BANGUNAN :</label>
        <div class="controls">
            <?php echo $form->textField($model, 'nama_pmk', array('class' => 'span2', 'maxlength' => 35)); ?>
        </div>
    </div>

    <div class="control-group ">
        <label class="control-label" for="Nama Pemilik">NO REGISTER BANK/BKP :</label>
        <div class="controls">
            <?php echo $form->textField($model, 'nama_pmk', array('class' => 'span2', 'maxlength' => 35)); ?>
        </div>
    </div>
    <br>

    <div class="control-group ">
        <label class="control-label" for="Nama Pemilik">NAMA PEMOHON :</label>
        <div class="controls">
            <?php echo $form->textField($model, 'nama_pmk', array('class' => 'span3', 'maxlength' => 35)); ?>
        </div>
    </div>
    <br>

    <div class="control-group ">
        <label class="control-label" for="Nama Pemilik">ALAMAT PEMOHON :</label>
        <div class="controls">
            <?php echo $form->textField($model, 'nama_pmk', array('class' => 'span3', 'maxlength' => 35)); ?>
        </div>
    </div>

    <div class="control-group ">
        <label class="control-label" for="Nama Pemilik">NPWP :</label>
        <div class="controls">
            <input type = "text" name="no_op[]" id="no_op" class="span1">
            <input type = "text" name="no_op[]" class="span1" >
            <input type = "text" name="no_op[]" class="span1" >
            <input type = "text" name="no_op[]" class="span1" >
            -
            <input type = "text" name="no_op[]" class="span1" >
            <input type = "text" name="no_op[]" class="span1" >
            <input type = "text" name="no_op[]" class="span1" >
            -

            <input type = "text" name="no_op[]" class="span1" >
            <input type = "text" name="no_op[]" class="span1" >
            <input type = "text" name="no_op[]" class="span1" >
            -
            <input type = "text" name="no_op[]" class="span1" >
            <input type = "text" name="no_op[]" class="span1" >
            <input type = "text" name="no_op[]" class="span1" >
            -
            <input type = "text" name="no_op[]" class="span1" >
            <input type = "text" name="no_op[]" class="span1" >
            <input type = "text" name="no_op[]" class="span1" >
            <input type = "text" name="no_op[]" class="span1" >
            -
            <input type = "text" name="no_op[]" class="span1" >

        </div>
    </div>



    <div class="control-group ">
        <label class="control-label" for="Nama Pemilik">TANGGAL PROSES :</label>
        <div class="controls">
            <?php
    $this->widget('zii.widgets.jui.CJuiDatePicker', array(
        'name' => 'publishDate',
        // additional javascript options for the date picker plugin
        'options' => array(
            'showAnim' => 'fold',
        ),
        'htmlOptions' => array(
            'style' => 'height:20px;'
        ),
    ));
    ?>

        </div>
    </div>

    <div class="control-group ">
        <label class="control-label" for="Nama Pemilik">TANGGAL CETAK :</label>
        <div class="controls">
            <?php echo $form->textField($model, 'nama_pmk', array('class' => 'span2', 'maxlength' => 35)); ?>
        </div>
    </div>


    <div class="form-actions">
        <?php
        $this->widget('bootstrap.widgets.TbButton', array(
            'buttonType' => 'submit',
            'type' => 'primary',
            'label' => $model->isNewRecord ? 'Create' : 'Save',
        ));
        ?>
    </div>

    <?php $this->endWidget(); ?>


    <?php
    $this->beginWidget('zii.widgets.jui.CJuiDialog', array(
        'id' => 'dialog-objek',
        'theme' => 'sunny',
        'themeUrl' => Yii::app()->request->baseUrl . '/css/themes',
        'options' => array(
            'title' => 'Data Objek',
            'width' => 600,
            'min-height' => 400,
            'autoOpen' => false,
            'buttons' => array(
                'Ok' => 'js:function(){$(this).dialog("close")}',),
        ),
    ));
    ?>


    <?php
    $this->widget('bootstrap.widgets.TbGridView', array(
        'id' => 'ObjekPajak',
        'dataProvider' => $model->search(),
        'filter' => $model,
        'columns' => array(
            array(
                'name' => 'no_op',
                'value' => '$data->no_op',
            ),
            array(
                'name' => 'nama_pmk',
                'value' => '$data->nama_pmk'
            ),
            array(
                'value' => 'CHtml::submitButton("Pilih",array("no_op"=>$data->no_op,"nama_pmk"=>$data->nama_pmk,"onClick"=>"PilihNop($(this).attr(\'no_op\'))"))',
                'type' => 'raw',
            ),
        ),
    ));
    ?>


    <?php
    $this->endWidget('zii.widgets.jui.CJuiDialog');
    ?>

    <?php
    $this->beginWidget('zii.widgets.jui.CJuiDialog', array(
        'id' => 'dialog-alert',
        'theme' => 'sunny',
        'themeUrl' => Yii::app()->request->baseUrl . '/css/themes',
        'options' => array(
            'title' => 'Data Objek',
            'width' => 600,
            'min-height' => 400,
            'autoOpen' => false,
            'buttons' => array(
                'Ok' => 'js:function(){$(this).dialog("close")}',),
        ),
    ));
    ?>

    <div id='txtAlert'></div>

    <?php
    $this->endWidget('zii.widgets.jui.CJuiDialog');
    ?>
</fieldset>